package com.nolydake.swingnote.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.LinkedHashMap;
import java.util.Map;

import com.nolydake.swingnote.SwingNoteApplication;

public class NoteDao extends AbstractDao {

    private static final Map<String, Column> COLUMNS = new LinkedHashMap<String, Column>();

    static {
        COLUMNS.put("id", new Column("id", "text", true, "唯一标识"));
        COLUMNS.put("forderId", new Column("forderId", "text", "关联的目录ID"));
        COLUMNS.put("name", new Column("name", "text", "标题"));
        COLUMNS.put("content", new Column("content", "text", "内容"));
        COLUMNS.put("lastUpdateTime", new Column("lastUpdateTime", "integer", "最后修改时间"));
    }

    @Override
    protected String initData() {

        Connection connection = null;
        try {
            connection = SwingNoteApplication.dataSource;
            PreparedStatement stmt = connection.prepareStatement("");
        } catch (SQLException e) {
            e.printStackTrace();
        }

        return null;
    }

    @Override
    protected String getTableName() {
        return "note";
    }

    @Override
    protected Map<String, Column> getColumns() {
        return COLUMNS;
    }
}
